<?php 
namespace Admin\Controller;
use Think\Controller;

class NormsController extends Controller
{	
	/**
	 * [index 跳转到商品参数展示页]
	 * @return [type] [description]
	 */
	public function index()
	{
		$norms = D('norms');
		$list = $norms->norms_sele();	
		$goods = I('get.goods');	
		$gid = I('get.id');
		$this->assign('goods',$goods);		//分配当前商品名值到展示页
		$this->assign('gid',$gid);			//分配当前商品id到参数页
		$this->assign($list);				

		$this->display('edit');
	}

	/**
	 * [add 更新商品参数页面]
	 */
	public function add()
	{
		$norms = D('norms');
		$res = $norms->norms_add();

		if($res=="over"){
			$this->error('输入的数据不能为空！','',2);
		}

		if($res == "update"){
			$this->success('数据已更新','',2);
		}else{
			$this->error('数据更新失败','',2);
		}
	}
}